/**
 * 
 */
package com.lehecai.ucenter.generator;

import java.util.Date;
import java.util.Random;

import com.lehecai.core.util.CharsetConstant;
import com.lehecai.core.util.CoreStringUtils;
import com.lehecai.ucenter.constant.GlobalConstant;

/**
 * @author qatang
 *
 */
public class AppTokenSecretGenerator {
	/**
	 * 生成子系统的token
	 * @return
	 */
	public static String generateAppToken() {
		return CoreStringUtils.md5(String.valueOf((new Date()).getTime()) + GlobalConstant.APP_TOKEN + String.valueOf(new Random().nextLong()), CharsetConstant.CHARSET_UTF8);
	}
	/**
	 * 生成子系统的secret
	 * @return
	 */
	public static String generateAppSecret() {
		return CoreStringUtils.md5(GlobalConstant.APP_SECRET + String.valueOf(new Random().nextLong()), CharsetConstant.CHARSET_UTF8);
	}
}
